aux_source_directory(. PLUGIN_CORE_SOURCES)
list(APPEND PLUGIN_CORE_SOURCES
    ${CMAKE_SOURCE_DIR}/include/janna/plugins/coreplugin/core.h
    ${CMAKE_SOURCE_DIR}/include/janna/plugins/coreplugin/coreplugin.h
)
qt_add_plugin(${core_plugin_name}
    CLASS_NAME CorePlugin
    ${PLUGIN_CORE_SOURCES}
)

set_target_properties(${core_plugin_name} PROPERTIES
    LIBRARY_OUTPUT_DIRECTORY "${plugin_dir}/janna.${core_plugin_name}-${PROJECT_VERSION}"
)

target_link_libraries(${core_plugin_name} PRIVATE
    ${janna_libs_utils_lib_name}
    ${janna_libs_extensionsystem_lib_name}
    Qt${QT_VERSION_MAJOR}::Core
    Qt${QT_VERSION_MAJOR}::Gui
    Qt${QT_VERSION_MAJOR}::Widgets
)

# 构建后动作
add_custom_command(TARGET ${core_plugin_name} POST_BUILD

    # 复制插件配置文件
    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/include/janna/plugins/coreplugin/janna.core.json ${plugin_dir}/janna.core-${PROJECT_VERSION}/janna.core.json
)
